package com.tengfei.main.user.domain.bo.info;

import com.tengfei.common.annotation.Sensitive;
import com.tengfei.common.enums.SensitiveStrategy;
import com.tengfei.common.xss.Xss;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * @author feige
 * @version v1.0
 * @date 2022-08-15-9:16
 * @description 用户实体Bo
 */

@Data
@ApiModel("用户信息业务对象")
public class UserInfoBo {



    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名",required = true)
    @Xss(message = "姓名不能包含脚本字符")
    @NotEmpty(message = "{姓名不能为空}")
    @Size(min = 0, max = 20, message = "姓名长度不能超过20个字符")
    private String name;


    /**
     * 用户邮箱
     */
    @Sensitive(strategy = SensitiveStrategy.EMAIL)
    @ApiModelProperty(value = "用户邮箱")
    @Email(message = "邮箱格式不正确")
    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
    private String email;

    /**
     * 手机号码
     */
    @Sensitive(strategy = SensitiveStrategy.PHONE)
    @ApiModelProperty(value = "手机号码",required = true)
    @NotEmpty(message = "{手机号不能为空}")
    @Size(min = 11, max = 11, message = "手机号请在合理范围内")
    private String phonenumber;

    /**
     * 部门id
     */
    @NotNull(message = "{部门id不能为空}")
    @ApiModelProperty(value = "部门id",required = true)
    private Long deptId;

    /**
     * 用户性别(0男1女2未知)
     */
    @ApiModelProperty(value = "用户性别(0男1女2未知)")
    private Integer sex;

    /**
     * 用户头像
     */
    @ApiModelProperty(value = "用户头像")
    private String avatar;


}
